// constants.v

`define WEXP	8
`define WSIG	23
`define WFLAG	5
`define WCONTROL 5

// output flag select (flags[x])
`define DIVZERO 	0
`define INVALID 	1
`define INEXACT 	2
`define OVERFLOW 	3
`define UNDERFLOW	4

`define WIDTH 		32 	
`define PRODWIDTH	48 	
`define SHIFTWIDTH	96 	
`define WPRENORM	24	
`define WEXPSUM		10	
`define BIAS		127	
`define WSIGMINUS1	22	
`define WSHIFTAMT	5	

`define UNDERBIAS	192	
`define OVERBIAS	-192	

`define	EXTRASIG	25		
`define	SHIFT		5		
`define	MAX_EXP		8'b11111110	
`define	INF_EXP		8'b11111111	

`define	MAX_SIG		23'b11111111111111111111111
`define	WEXP_0		8'b0		
`define	WEXP_1		8'b1		
`define	WSIG_0		23'b0		
`define	WSIG_1		23'b1		
`define	EXTRASIG_0	25'b0		

`define	MAXSHIFT	24		

`define CONSTNAN	{9'b1111_1111_1,22'b0}
`define CONSTZERO	31'b0
`define CONSTINFINITY	{8'b1111_1111, 23'b0}
`define CONSTLARGEST	{`MAX_EXP, `MAX_SIG}
`define PRESHIFTZEROS  48'b0 

`define ACS_Kp 32'h3f80_0000
`define ACS_Kd 32'h3f80_0000